﻿using System;
using System.Collections.Generic;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Web;

namespace DeliveryService
{
    public class BaseClass
    {
        public static string md5(string str)
        {
            MD5 m = new MD5CryptoServiceProvider();
            byte[] s = m.ComputeHash(UnicodeEncoding.UTF8.GetBytes(str));
            return BitConverter.ToString(s);
        }

        public static string GenerateOrderNumber()
        {
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }

    }

    public partial class DeliveryDBDataContext : System.Data.Linq.DataContext
    {
        [Function(Name = "NewID", IsComposable = true)]        
        public Guid NewID()
        {
            return ((Guid)(this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod()))).ReturnValue));
        }
    }
}